#ifndef SET_H
#define SET_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/**************************************
 *          Data Structures           *
 **************************************/

struct lists_set {
  void               *object;
  int                size;
  struct lists_set   *next;
};

struct _SET {
  int                size;
  struct lists_set   *first;
};

typedef struct _SET  set;


/**************************************
 *             bibteco.c              *
 **************************************/

set  * setUnion          (set  *op1  , set  *op2);

set  * setDifference     (set  *op1  , set  *op2);

set  * setProduct        (set  *op1  , set  *op2);

set  * setIntersection   (set  *op1  , set  *op2);

int    setBelong         (set  *op1  , void *value,  int  size);

int    setContained      (set  *op1  , set  *op2);

int    setStrictlyContained      (set  *op1  , set  *op2);

set  * toSet             (set  *src  , void *value,  int  size);

set  * setRemove         (set  *src  , void *value,  int  size);

set  * emptySet          ();

void setFree             (set *src);

set  * setCopy           (set *src);

int cardinalidade        (set *src);

int isEmpty              (set *src);

int igualdade            (set  *op1  , set  *op2);


/* Auxiliar functions */
void create_item(struct lists_set * new, struct lists_set * next, void *value, int size);

int compare_elements(struct lists_set * tested, void *value, int size);

int find_item(struct lists_set * init, void *value, int size);

void printSetInt(set *src);

#endif
